package com.mapTest;


import java.util.*;

/**
 * @Author weijingchen
 * @Date 2025/6/13 22:50
 * @Version 1.0.0
 */
public class Test03 {
    public static void main(String[] args) {

        Random random = new Random();
        List<String> list = new ArrayList<>();
        Collections.addAll(list, "张1", "张2", "张3", "张4", "张5", "张6", "张7", "张8", "张9", "张10");
        int count = 0;
        ArrayList<String> list2 = new ArrayList<>();

        while (true) {
            count++;
            if (list.isEmpty()) {
                System.out.println("------------------------");
                list.addAll(list2);
                list2.clear();
            }
            int i = random.nextInt(list.size());
            String name = list.remove(i);
            list2.add(name);
            System.out.println(name);
            if (count == 100) {
                break;
            }
        }
        HashMap<Object, Object> map = new HashMap<>();
        Map<Object, Object> mapOf = Map.ofEntries(map.entrySet().toArray(new Map.Entry[0]));
    }
}
